<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Define a Direct AvaloniaProperty</Title>
            <Shortcut>avdr</Shortcut>
            <Description>Code snippet for a Direct Avalonia Property</Description>
            <Author>Nick Polyak</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>property</ID>
                    <ToolTip>Property Name</ToolTip>
                    <Default>MyProperty</Default>
                </Literal>
                <Literal>
                    <ID>type</ID>
                    <ToolTip>Property Type</ToolTip>
                    <Default>double</Default>
                </Literal>
                <Literal>
                    <ID>ownerclass</ID>
                    <ToolTip>The owning class of this Property.  Typically the class that it is declared in.</ToolTip>
                    <Function>ClassName()</Function>
					<Default>ownerclass</Default>
                </Literal>
            </Declarations>
            <Code Language="csharp">
                <![CDATA[
#region $property$ Direct Avalonia Property
private $type$ _$property$ = default;

public static readonly DirectProperty<$ownerclass$, $type$> $property$Property =
    AvaloniaProperty.RegisterDirect<$ownerclass$, $type$>
    (
        nameof($property$),
        o => o.$property$,
        (o, v) => o.$property$ = v
    );

public $type$ $property$
{
   get => _$property$;
   set 
   {
       SetAndRaise($property$Property, ref _$property$, value);
   }
}

#endregion $property$ Direct Avalonia Property
$end$]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
